

const defaultState = {
    inputValue : '默认',
    deviceType:''

}

// eslint-disable-next-line import/no-anonymous-default-export
export default (state = defaultState,action)=>{  //就是一个方法函数
    let newState = JSON.parse(JSON.stringify(state))
    if(action.type === 'editinputValue' ){
        newState.inputValue = '修改'
        return newState
    }
    if(action.type === 'editDeviceType'){
        newState.deviceType = action.index
        return newState
    }
    return state
}
